/* 
 * File:   Entry.h
 * Author: Cody TV Weber
 *
 * Created on March 18, 2014, 10:48 AM
 */

using namespace System;
using namespace System::Text;

#ifndef ENTRY_H
#define	ENTRY_H

// README*********Check .cpp for comments*********

ref class Entry : public IComparable{
public:
    Entry(String^ word);
    Entry(String^ word, 
            int countInHam, 
            int countInSpam, 
            int totalNumberOfHam, 
            int totalNumberOfSpam, 
            double percentageInHam, 
            double percentageInSpam, 
            double spamIndication);
    virtual ~Entry();

	virtual int CompareTo(Object^ e) override
	{
		return -(safe_cast<Entry^>(e)->GetWord()->ToLower()->CompareTo(word->ToLower()));
	};
    void calculateHamPercentage();
    void calculateSpamPercentage();
    void addHamOccurrence();
    void addSpamOccurrence();

    // <editor-fold defaultstate="collapsed" desc="Getter and Setter for Total Number of Emails">

    int getTotalNumberOfHam() {
        return totalNumberOfHam;
    }

    void setTotalNumberOfHam(int totalNumberOfHam) {
        this->totalNumberOfHam = totalNumberOfHam;
    }

    int getTotalNumberOfSpam() {
        return totalNumberOfSpam;
    }

    void setTotalNumberOfSpam(int totalNumberOfSpam) {
        this->totalNumberOfSpam = totalNumberOfSpam;
    }// </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="Getters">

    int GetCountInHam()  {
        return countInHam;
    }

    int GetCountInSpam()  {
        return countInSpam;
    }

    double GetPercentageInHam()  {
        return percentageInHam;
    }

    double GetPercentageInSpam()  {
        return percentageInSpam;
    }

    String^ GetWord()  {
        return word;
    }

    double getSpamIndication()  {
        return spamIndication;
    }
    // </editor-fold>
private:
    String^ word;
    double percentageInSpam;
    double percentageInHam;
    double spamIndication;
    int countInSpam;
    int countInHam;
    int totalNumberOfSpam;
    int totalNumberOfHam;

    void calculateSpamIndicator();

    // <editor-fold defaultstate="collapsed" desc="Setters">

    void SetCountInHam(int countInHam) {
        this->countInHam = countInHam;
    }

    void SetCountInSpam(int countInSpam) {
        this->countInSpam = countInSpam;
    }

    void SetPercentageInHam(double percentageInHam) {
        this->percentageInHam = percentageInHam;
    }

    void SetPercentageInSpam(double percentageInSpam) {
        this->percentageInSpam = percentageInSpam;
    }

    void SetWord(String^ word) {
        this->word = word;
    }

    void setSpamIndication(double spamIndication) {
        this->spamIndication = spamIndication;
    }
    // </editor-fold>
};

#endif	/* ENTRY_H */

